<%@page import="com.crossriver.crgis.database.service.persistence.Application_C_of_OUtil"%>
<%@page import="com.liferay.portal.theme.ThemeDisplay"%>
<%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@page
	import="com.crossriver.crgis.database.model.Application_C_of_O"%>
<%@ page
	import="com.crossriver.crgis.cofo.util.ApplicationCofOConstants"%>

<%@ include file="/init.jsp"%>

 



<liferay-portlet:actionURL name="saveAttestationInformation"
	var="saveAttestationInformation"></liferay-portlet:actionURL>

<%
	Application_C_of_O appl = (Application_C_of_O) request
			.getAttribute(ApplicationCofOConstants.APPL_C_OF_O_SESSION_ATTR);

Application_C_of_O applicatn = 
	Application_C_of_OUtil.findByPrimaryKey(appl.getApplicationId());


%>

<aui:form action="<%=saveAttestationInformation.toString()%>"
	 method="post" name="submitSupportingDoc_fm">
	
	 <% String app = applicatn.getApplication(); %>
 <div id="main">
	<%
	if("certification".equalsIgnoreCase(app)){
	%>
	<h1>Application for Certificate Of Occupancy</h1>
	<%
	}else if("re-certification".equalsIgnoreCase(app)){
	%>
	<h1>Application for Re-Certificate Of Occupancy</h1>
	<%
	}else {
	%>
	<h1>Application for State Land</h1>
	<%
	}
	%>
	
	<div class="content">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
			<td width="15%" valign="top">
		  	<aui:input name="applicationId"	type="hidden" value="<%= appl.getApplicationId() %>"></aui:input>
				<aui:input name="buttonClicked" type="hidden" value=""></aui:input>
				<table width="100%" id="steps" cellpadding="0" cellspacing="0">
       		<tr><td valign="middle" align="center">STEP 1</td></tr>
       		<tr><td valign="middle" align="center">STEP 2</td></tr>
	        <tr><td valign="middle" align="center">STEP 3</td></tr>
          <tr><td valign="middle" align="center">STEP 4</td></tr>
          <tr><td valign="middle" align="center">STEP 5</td></tr>
          <tr><td valign="middle" align="center" class="current">STEP 6</td></tr>
          <tr><td valign="middle" align="center">STEP 7</td></tr>
          <tr><td valign="middle" align="center">STEP 8</td></tr>                               
       	</table>
			</td>
			<td width="85%" valign="top">
				<table width="100%" id="mainform">
					<tr>
						<td class="title">Declaration/Attestation</td>
					</tr>
					<tr>
						<td colspan="3" align="right" style="padding-right: 20px">
							<hr>
							<aui:button type="button" value="Exit Application" onClick="exitApplication();"></aui:button>
             	
              
             	<aui:button type="submit" value="Save" onClick="setButtonClicked('btnSave');" ></aui:button>
            	<aui:button type="submit" value="Save and Continue" onClick="setButtonClicked('btnSaveAndContinue');" ></aui:button>
             	<aui:button type="button" value="Cancel Application" onClick="confirmPost()"></aui:button>
						</td>
					</tr>
					<tr>
						<td colspan="3"><br>
							<p><liferay-ui:error key="you-must-check-attestation-to-procced"	 message="you-must-check-attestation-to-procced" /></p>
							<p>"It is a punishable offence to provide any false information and or make any false statements or claim when
							completing this form. Where it is subsequently discovered that a Certificate of Occupancy was issued based on false or inaccurate
							information, the Governor may in his sole discretion, revoke such Certificate of Occupancy.</p>
							<p>the Governor reserves the right to reject any application for not properly or fully completed and shall not incur any
							liability for any such revocation".</p>
							<p>The information you supply on this form is public knowledge and may be published in the media.</p>
							<p><aui:input name="attestation" type="checkbox" label=""  value="true"/> I attest that all information entered are accurate and have been review by
							me. I also declare that i am liable for all information entered above.</p>
							<p>For further enquiries, complaints or questions, contact:</p>
							<p>CrossRiver State Geographic Information Systems (CSGIS)<br>
							Old Secretariat Road<br>By Murtala Mohammed Highway, Calabar<br>Cross River State, Nigeria<br>
								Tel. </p>
						</td>
					</tr>
					<tr>
						<td colspan="3" align="right"><br>
							<hr>
							<aui:button type="button" value="Exit Application" onClick="exitApplication();"></aui:button>
             	
              
             	<aui:button type="submit" value="Save" onClick="setButtonClicked('btnSave');" ></aui:button>
            	<aui:button type="submit" value="Save and Continue" onClick="setButtonClicked('btnSaveAndContinue');" ></aui:button>
             	<aui:button type="button" value="Cancel Application" onClick="confirmPost()"></aui:button>
						</td>
					</tr>
				</table>
			</td>
			</tr>
		</table>
	</div>
</div>
</aui:form>

	<liferay-portlet:actionURL name="exitApplication" var="exitApplication"></liferay-portlet:actionURL>
	<form name="<portlet:namespace/>exitApplication_fm" method="post"	id="<portlet:namespace/>exitApplication_fm" action="<%=exitApplication.toString()%>"></form>
	<script type="text/javascript">
	<!--
	function exitApplication()
	{
		document.forms["<portlet:namespace/>exitApplication_fm"].submit();
	}
	//-->
	</script>

<script type="text/javascript">
<!--
	function confirmPost()
	{
	var agree=confirm("Cancelling the process will delete the record you have entered into the portal for this application. Do you want to proceed?");
	if (agree){
		document.forms["<portlet:namespace/>deleteApplication_fm"].submit();
		return true ;
	}
	else{
		return false ;
	}
	}
//-->
</script>

<liferay-portlet:actionURL name="deleteApplication" var="deleteApplication"></liferay-portlet:actionURL>
 <aui:form action="<%=deleteApplication.toString() %>" method="post" name="deleteApplication_fm">
  	<aui:input name="applicationId" type="hidden" value="<%= appl.getApplicationId() %>"></aui:input>
 </aui:form>
 
 